package alt;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import model.Person;

/**
 * @author dorina-sabine.bernhardt@stud.hdu-deggendorf.de Benoegtigte Lib:
 *         WebContent/WEB-INF/lib/ejb3-persistence.jar Letzte Aenderung:
 *         29.04.12 SB Klassenimplementierung
 */
@Entity
@Table(name = "tbl_buchung")
public class Buchung {
	@Id
	@GeneratedValue
	@Column(name = "bid")
	private Integer id;
	private Date von;
	private Date bis;
	private int Bewertung;

	@ManyToOne
	@JoinColumn(name = "pid", nullable = false)
	private Person nachfrager;

	@ManyToOne
	/* (targetEntity=om.Boot.class) */
	@JoinColumns({ @JoinColumn(name = "PID", referencedColumnName = "PID"),
			@JoinColumn(name = "ATID", referencedColumnName = "ATID") })
	private Angebot angebot;

	public Buchung() {
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Date getVon() {
		return von;
	}

	public void setVon(Date von) {
		this.von = von;
	}

	public Date getBis() {
		return bis;
	}

	public void setBis(Date bis) {
		this.bis = bis;
	}

	public int getBewertung() {
		return Bewertung;
	}

	public void setBewertung(int Bewertung) {
		this.Bewertung = Bewertung;
	}

	public Person getNachfrager() {
		return nachfrager;
	}

	public void setNachfrager(Person nachfrager) {
		this.nachfrager = nachfrager;
	}

	public Angebot getAngebot() {
		return angebot;
	}

	public void setAngebot(Angebot angebot) {
		this.angebot = angebot;
	}
}
